<template>
    <view class="container">
        <view class="tit">
             美国感染新冠病毒激增,华盛顿恢复"室内戴口罩令"
        </view>
        <view class="sectit">
             <span>VOA常速听力</span>  <span> 2021-08-21</span> 
        </view>
        <view class="img">
           <!-- <img src="../../static/main.png"  alt="占位符" srcset=""> -->
           <img :src="addr.imageUrl"  alt="占位符" srcset="">
        </view>
		<view class="content">
			<view v-for="(item,index) in article" :key='index'>
				<p class='Eng'>{{item}}</p>
				<!-- <p class='Eng'>{{item.English}}</p> -->
				<!-- <p class='Ch'>{{item.chinese}}</p> -->
			</view>
			<view>55277人听过</view>
		</view>
    </view>
</template>
<script>
// import 
export default {
    data(){
        return{
            addr:"",
			timeout:"",
			timeintervel:"",
			time:0,
            article:[
				// {
				// 	English:"This is VOA News. Reporting by remote, I'mDavid Byrd.",
				// 	chinese:'这里是美国之音新闻，我是大卫，伯德，为您远程报道。'
				// },
				// {
				// 	English:"President Joe Biden is ordering tough newvaccination rules for federal workers as thedelta variant continues sweeping across theUnited States. AP's Sagar Meghani reports.",
				// 	chinese:'总统乔.拜登下令对联邦工作人员实施严格的疫苗接种新规定，因为德尔塔变种病毒持续席卷美国。美联社赛格尔.梅格哈尼为您报道。'
				// },
				// {
				// 	English:"In a somber address, the president lamentedthat effective vaccines are available to allAmericans, yet people continue dying fromCOVID-19.",
				// 	chinese:'总统在一次严肃的讲话中哀叹道，所有美国人都能够接种到有效的疫苗，但仍有人死于新冠肺炎。'
				// },{
				// 	English:"This is an American tragedy.",
				// 	chinese:'这是美国的悲剧'
				// },{
				// 	English:"In a bid to boost flagging vaccination rates, thepresident will require federal workers to attestthat they' ve been vaccinated or face mandatory masking, testing and other rules.He' S also asking the Pentagon to look at addingthe COVID shots do vaccines troops are required to get and he s urging state and localgovernments to offer $100 to people who getshots.",
				// 	chinese:'为了提高不断下降的疫苗接种率，总统将要求联邦工作.人员证明他们已经接种了疫苗，否则会面临强制戴口罩、检测等规定。他还要求五角大楼考虑增加军队需要接种的疫苗，他敦促各州和地方政府为接种疫苗的人奖励100美元。'
				// },{
				// 	English:"With incentives and mandates, we can make ahuge difference and save a lot of lives.",
				// 	chinese:'有了激励和命令,我们就能作出很大改变,拯救很多生命。'
				// },{
				// 	English:"Sagar Meghani, Washington.",
				// 	chinese:'赛格尔.梅格哈尼，于华盛顿。'
				// },{
				// 	English:"The city of Washington D.C. will require masks ;indoors for everyone older than two years oldbeginning Saturday because of an increase incoronavirus infections. Mayor Muriel Bowsermade the announcement Thursday at a newsconference.",
				// 	chinese:'由于冠状病毒感染增加，华盛顿特区要求从周六开始所有两岁以上的人在室内佩戴口罩。市长穆里尔.鲍泽星期四在新闻发布会上宣布了这一消息。'
				// },{
				// 	English:"'Beginning this Saturday at 5 a.m., I will issue .by mayor's order the directive that people overthe age of 2 must wear a mask indoors,regardless of their vaccination status.'",
				// 	chinese:'“从本周六早.上5点开始,我将以市长的身份发布命令，要求2岁以上的人在室内必须戴口罩，无论是否接种了疫苗。”'
				// },{
				// 	English:"The mayor said that in the month of July, thecity has seen a fivefold increase in the dailycase rate. People may remove masks whileeating or drinking inside restaurants but,otherwise, will be required to wear them.Outdoor venues, such as park in sports stadiums, are exempt from the order but healthofficials are recommending people wear maskswhen attending large events.",
				// 	chinese:'市长表示，在7月份，该市的每日新增病例增加了5倍。人们可以在餐馆吃饭或喝酒时摘下口罩，其它时候将被要求戴_上口罩。户外场所，如体育场馆公园，不受该命令的限制，但卫生官员建议人们在参加大型活动时佩戴口罩。'
				// },{
				// 	English:"'This is VOA News.",
				// 	chinese:'这里是美国之音新闻。'
				// }
				
			]
        }
    },
    onLoad(e) {
        if(e.addr){
            this.addr = JSON.parse(e.addr)
            // console.log(this.addr.ids);
			// uni.$emit("saveFile",{asserUrl:this.addr.asserUrl,playLine:"",getwords:this.article})
			uni.$emit("bluePlay",this.addr.ids,this.article)
			this.request()
			this.timeintervel = setInterval(()=>{
				this.time++
			},1000)
        }
    },
	methods:{
		request(){
		this.timeout = 	setTimeout(()=>{
					 uni.request({
                    			  url: 'http://139.9.151.197:8889/app/home/article/'+ this.addr.id,
                    			  complete: (res) => {},
                    			  data: {},
                    			  fail: (res) => {},
                    			  method: "GET",
                    			  success: (result) => {
                    			      console.log("result",result);
                    			  },
                    			})
					 },2000)
			
		},
	},
	destroyed(){
		console.log("ininindestroyed",this);
		if(this.timeout){
			uni.$emit("Listenersadd",this.addr.id)
			// console.log("ininindestroyed",this);
		}
		clearInterval(this.timeintervel)
		clearTimeout(this.timeout)
		let api = `${this.$cache.get("UserName")}/?time=${this.time}`
		console.log(`this.$cache.get("UserName")`,this.$cache.get("UserName"));

		// if(this.$cache.get("UserName") && !uni.getStorageSync("deviceId")){
		if(this.$cache.get("UserName")){
			this.$myRequest({
					url:'/app/home/add_user_time/'+api,
					method:'get',
					data:{
						// username:item.userName,
						// tag:item.tag,
					}
				}).then(res=>{
						console.log("返回参数",res);
						console.log("点赞成功")
					}
					).catch(err =>{
						console.log(err)
					})			
		}
		uni.$$emit("createInnerAudioContext_destroy")
	}
}
</script>
<style lang="scss" scoped>
.container{
    height:100%;
    width:95%;
    box-sizing: border-box;
    margin:0 auto;
    padding-top: 15px;
    & .tit{
        font-size:18px;
        line-height: 1.5;
        word-break: break-all;
    }
    & .sectit{
        line-height:3;
        & span:first-of-type{
            color:#576B95;
            margin-right: 5px;
        }
         & span:last-of-type{
            color:#576B95;
            color:#999999
        }
    }
    & .img{
        text-align: center;
        width:90%;
        margin: 0 auto;
        height:235px;
        box-shadow: 4px 6px 10px grey ;
        & img{
            width:100%;
            height:100%;
        }
    }
	.content{
		width: 95%;
		margin: 20px auto;
		// border: red 1px solid;
		.Eng{
			font-size: 16px;
			line-height: 30px;
			margin-bottom: 20px;
		}
		.Ch{
			font-size: 14px;
			color: #007AFF;
			line-height: 30px;
			margin-bottom: 20px;
		}
	}

}
</style>